# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-cstruct
pkgver=5.2
pkgrel=0
pkgdesc="C-style structs for Python"
url="https://github.com/andreax79/python-cstruct"
license="MIT"
arch="noarch !s390x" # test_union_unpack test fails on s390x
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/andreax79/python-cstruct/archive/v$pkgver/py3-cstruct-$pkgver.tar.gz"
builddir="$srcdir/python-cstruct-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/cstruct-$pkgver-py2.py3-none-any.whl
}

sha512sums="
d9a961270e4769d1133a459f952f22b42733421436c53ac9bfc8159330503af1a2231c99afb2e91863ee8ad4d822a0d84fc6db6aac11b5358bca5548f0006e3e  py3-cstruct-5.2.tar.gz
"
